package com.sunshuo.springsecuritydemo.service;

import com.sunshuo.springsecuritydemo.dao.RoleDao;
import com.sunshuo.springsecuritydemo.pojo.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @ClassName RoleService
 * @Description
 * @Author sunshuo
 * @Date 2021/11/7 20:27
 */
@Service
public class RoleService {

    private RoleDao roleDao;

    @Autowired
    public void setRoleDao(RoleDao roleDao) {
        this.roleDao = roleDao;
    }

    public List<Role> getRoles() {
        return roleDao.getRoles();
    }

    public List<String> getRoleNameByUserId(String userId) {
        return roleDao.getRoleNameByUserId(userId);
    }

    public Map<String, Set<String>> getAllResRoleNames() {
        return roleDao.getAllResRoleNames();
    }
}
